fix: support namespace in aggregation name#150
Conversation
Aggregation tags must have the same namespace as their parent control tag. This is now supported in code completion, validations and hover. Additionally, don't filter out the current aggregation during code completion.
| * Split possibly qualified tag or attribute name to namespace and name | ||
| * @param qName | ||
| */ | ||
| export function splitQNameByNamespace( |
There was a problem hiding this comment.
This possibly belongs in XML-ToolsQNameis ambiguous, is this "x.y.z" (regular fqn) or XMLNs fqn "foo:bar"
There is no way to tell from the docs.- I know its the xmlns name... so in that case it should use xmlns terms, e.g:
- ns --> prefix
There was a problem hiding this comment.
This possibly belongs in XML-Tools
Actually I agree, but I don't think I'll have time to move it this sprint.
QNameis ambiguous, is this "x.y.z" (regular fqn) or XMLNs fqn "foo:bar"
There is no way to tell from the docs.
I'll improve the comment to make it clearer that it's related to xml qualified names.
I know its the xmlns name... so in that case it should use xmlns terms, e.g:
- ns --> prefix
Ok
There was a problem hiding this comment.
I know its the xmlns name... so in that case it should use xmlns terms, e.g:
- ns --> prefix
On the xml element it's called ns, even though it's the prefix and not the resolved namespace.
There was a problem hiding this comment.
On the xml element it's called ns, even though it's the prefix and not the resolved namespace.
Yes that is a mistake I've made, but fixing that would be a serious breaking change
| ns: matchGroups.ns, | ||
| name: | ||
| matchGroups.name ?? | ||
| /* istanbul ignore next */ |
There was a problem hiding this comment.
Actually it's unnecessary, I'll remove the ??
Do the namespace prefixes need to be syntactically equivalent or could they also be resolved to the same namespace? e.g:
|
I tested it now and it seems that they can be equivalent instead of the same prefix (non-default and default or both non-default - it works). As a side note, I could not get |
Fixed |
"Work" in what context? |
| * Return the xml namespace defined for the xml element prefix (ns), or undefined if not found | ||
| * @param xmlElement | ||
| */ | ||
| export function resolveXMLNS(xmlElement: XMLElement): string | undefined; |
There was a problem hiding this comment.
These are all very useful utils, we will need to move them to XML-Tools at a later time though
It doesn't work, as in, I get a runtime error that "content" was not found, and it seems that it searches for it by URL like it's a class. |
|
If we have a runtime error we need to open a bug with reproduceable test case |
Aggregation tags must have the same namespace as their parent control tag.
This is now supported in code completion, validations and hover.
Additionally, don't filter out the current aggregation during code completion.